/******************************init****************************/
function queryOrganActivities(page) {
	var parm = $('#queryOrganActivitiesForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('organactivities-query');
	sys_record_parm('organactivities',parm);
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}

function deleteOrganActivities(code) {
	$.Zebra_Dialog('是否删除',{
				'type': 'question',
				'title': '警告' ,
				'buttons':[
				           {caption:'删除',callback:function() {
				        	var url = create_url('organactivities-delete');
							organActivities_aidExecute(code, url);
				    		}},
				           {caption:'取消',callback:function(){}
				    	}]
				});
}

function organActivities_aidExecute(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功');
				queryOrganActivities();
			} else {
				sys_msg('操作失败');
				queryOrganActivities();
			}
		}
	});
}

function topOa(code) {
	$.Zebra_Dialog('是否要置顶',{
					'type': 'question',
					'title': '警告' ,
					'buttons':[
					           {caption:'置顶',callback:function() {
					        		var url = create_url('organactivities-organActivitiesTop')
									var parm = {'code':code};
									sys_submiting();
									$.ajax({type:'POST', url:url, data:parm,
										success: function(result) {
											sys_submiting_close();
											if ('success' == result) {
												sys_msg('置顶成功');
												queryOrganActivities();
											} else {
												sys_msg('操作失败');
												queryOrganActivities();
											}
										}
									});
					    		}},
					           {caption:'取消',callback:function(){}
					    	}]
					});
}
/************edit******************/
function saveOrganActivities() {
	var parm = $('#editOrganActivitiesForm').serialize() + '&content=' + fixJqText(Url.encode(content.getData()));
	var url = create_url('organactivities-save');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
		sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功!');
				sys_load_handle('organactivities');
			}
		}
	});
}

function checkedOrganActivities(){
	var title = $("#title").val();
	if(title.length==0){
		sys_msg('必须填写标题');
	}else{
		saveOrganActivities();
	}
}
/******************************aidinit****************************/

/******************************aidbatchinit****************************/
